package com.ruoyi.wasterTran.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.SnowflakeIdUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.wasterTran.mapper.TConstructionWasteTransportationOrderRecordMapper;
import com.ruoyi.wasterTran.domain.TConstructionWasteTransportationOrderRecord;
import com.ruoyi.wasterTran.service.ITConstructionWasteTransportationOrderRecordService;

/**
 * 建筑垃圾联单状态跟踪Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-01-11
 */
@Service
public class TConstructionWasteTransportationOrderRecordServiceImpl implements ITConstructionWasteTransportationOrderRecordService 
{
    @Autowired
    private TConstructionWasteTransportationOrderRecordMapper tConstructionWasteTransportationOrderRecordMapper;

    /**
     * 查询建筑垃圾联单状态跟踪
     * 
     * @param id 建筑垃圾联单状态跟踪主键
     * @return 建筑垃圾联单状态跟踪
     */
    @Override
    public TConstructionWasteTransportationOrderRecord selectTConstructionWasteTransportationOrderRecordById(String id)
    {
        return tConstructionWasteTransportationOrderRecordMapper.selectTConstructionWasteTransportationOrderRecordById(id);
    }

    /**
     * 查询建筑垃圾联单状态跟踪列表
     * 
     * @param tConstructionWasteTransportationOrderRecord 建筑垃圾联单状态跟踪
     * @return 建筑垃圾联单状态跟踪
     */
    @Override
    public List<TConstructionWasteTransportationOrderRecord> selectTConstructionWasteTransportationOrderRecordList(TConstructionWasteTransportationOrderRecord tConstructionWasteTransportationOrderRecord)
    {
        return tConstructionWasteTransportationOrderRecordMapper.selectTConstructionWasteTransportationOrderRecordList(tConstructionWasteTransportationOrderRecord);
    }

    /**
     * 新增建筑垃圾联单状态跟踪
     * 
     * @param tConstructionWasteTransportationOrderRecord 建筑垃圾联单状态跟踪
     * @return 结果
     */
    @Override
    public int insertTConstructionWasteTransportationOrderRecord(TConstructionWasteTransportationOrderRecord tConstructionWasteTransportationOrderRecord)
    {
        SnowflakeIdUtils idWorker = new SnowflakeIdUtils(1, 3);
        tConstructionWasteTransportationOrderRecord.setId(idWorker.nextId()+"");
        tConstructionWasteTransportationOrderRecord.setCreateTime(DateUtils.getNowDate());
        tConstructionWasteTransportationOrderRecord.setCreateTime(DateUtils.getNowDate());
        return tConstructionWasteTransportationOrderRecordMapper.insertTConstructionWasteTransportationOrderRecord(tConstructionWasteTransportationOrderRecord);
    }

    /**
     * 修改建筑垃圾联单状态跟踪
     * 
     * @param tConstructionWasteTransportationOrderRecord 建筑垃圾联单状态跟踪
     * @return 结果
     */
    @Override
    public int updateTConstructionWasteTransportationOrderRecord(TConstructionWasteTransportationOrderRecord tConstructionWasteTransportationOrderRecord)
    {
        tConstructionWasteTransportationOrderRecord.setUpdateTime(DateUtils.getNowDate());
        return tConstructionWasteTransportationOrderRecordMapper.updateTConstructionWasteTransportationOrderRecord(tConstructionWasteTransportationOrderRecord);
    }

    /**
     * 批量删除建筑垃圾联单状态跟踪
     * 
     * @param ids 需要删除的建筑垃圾联单状态跟踪主键
     * @return 结果
     */
    @Override
    public int deleteTConstructionWasteTransportationOrderRecordByIds(String[] ids)
    {
        return tConstructionWasteTransportationOrderRecordMapper.deleteTConstructionWasteTransportationOrderRecordByIds(ids);
    }

    /**
     * 删除建筑垃圾联单状态跟踪信息
     * 
     * @param id 建筑垃圾联单状态跟踪主键
     * @return 结果
     */
    @Override
    public int deleteTConstructionWasteTransportationOrderRecordById(String id)
    {
        return tConstructionWasteTransportationOrderRecordMapper.deleteTConstructionWasteTransportationOrderRecordById(id);
    }
}
